inherited fmSCApproving: TfmSCApproving
  Left = 88
  Top = 54
  Width = 980
  Height = 484
  Caption = 'fmSCApproving'
  Constraints.MinHeight = 484
  Constraints.MinWidth = 980
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  inherited sbBottom: TStatusBar
    Top = 419
    Width = 964
  end
  inherited Panel1: TPanel
    Width = 964
    Visible = False
    inherited BitBtn1: TBitBtn
      Left = 789
    end
    inherited BitBtn2: TBitBtn
      Left = 877
    end
  end
  object dbgPeopleFind: TcxGrid [2]
    Left = 0
    Top = 45
    Width = 964
    Height = 374
    Align = alClient
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 2
    LookAndFeel.Kind = lfStandard
    LookAndFeel.SkinName = 'Blue'
    object tvPeopleFind: TcxGridDBTableView
      NavigatorButtons.ConfirmDelete = False
      NavigatorButtons.First.Visible = True
      NavigatorButtons.PriorPage.Visible = True
      NavigatorButtons.Prior.Visible = True
      NavigatorButtons.Next.Visible = True
      NavigatorButtons.NextPage.Visible = True
      NavigatorButtons.Last.Visible = True
      NavigatorButtons.Insert.Visible = False
      NavigatorButtons.Append.Visible = False
      NavigatorButtons.Delete.Visible = False
      NavigatorButtons.Edit.Visible = False
      NavigatorButtons.Post.Visible = False
      NavigatorButtons.Cancel.Visible = False
      NavigatorButtons.Refresh.Visible = False
      NavigatorButtons.SaveBookmark.Visible = False
      NavigatorButtons.GotoBookmark.Enabled = False
      NavigatorButtons.GotoBookmark.Visible = False
      NavigatorButtons.Filter.Visible = False
      FilterBox.CustomizeDialog = False
      FilterBox.Visible = fvNever
      OnCellDblClick = tvPeopleFindCellDblClick
      DataController.DataSource = dlgDS
      DataController.Summary.DefaultGroupSummaryItems = <>
      DataController.Summary.FooterSummaryItems = <
        item
          Kind = skCount
          FieldName = 'PID'
          Column = tvPeopleFindPID
          DisplayText = #1042#1089#1077#1075#1086' '#1085#1072#1081#1076#1077#1085#1086' '#1089#1086#1080#1089#1082#1072#1090#1077#1083#1077#1081
        end>
      DataController.Summary.SummaryGroups = <>
      DataController.Summary.Options = [soNullIgnore]
      OptionsBehavior.CellHints = True
      OptionsBehavior.FocusFirstCellOnNewRecord = True
      OptionsBehavior.IncSearch = True
      OptionsCustomize.ColumnFiltering = False
      OptionsCustomize.ColumnGrouping = False
      OptionsData.CancelOnExit = False
      OptionsData.Deleting = False
      OptionsData.DeletingConfirmation = False
      OptionsData.Editing = False
      OptionsData.Inserting = False
      OptionsView.NavigatorOffset = 5
      OptionsView.NoDataToDisplayInfoText = '<'#1053#1077#1090' '#1076#1072#1085#1085#1099#1093'>'
      OptionsView.CellAutoHeight = True
      OptionsView.CellTextMaxLineCount = 1
      OptionsView.ColumnAutoWidth = True
      OptionsView.ExpandButtonsForEmptyDetails = False
      OptionsView.Footer = True
      OptionsView.GroupByBox = False
      OptionsView.HeaderEndEllipsis = True
      OptionsView.Indicator = True
      OptionsView.ShowColumnFilterButtons = sfbAlways
      Styles.Content = DMInv.cxData
      Styles.IncSearch = DMInv.cxGreenText
      Styles.Header = DMInv.cxSiniyText
      object tvPeopleFindPID: TcxGridDBColumn
        DataBinding.FieldName = 'PID'
        Width = 35
      end
      object tvPeopleFindPP: TcxGridDBColumn
        Caption = #1060#1048#1054' '#1088#1077#1073#1077#1085#1082#1072
        DataBinding.FieldName = 'PP'
        Width = 130
      end
      object tvPeopleFindPODR: TcxGridDBColumn
        Caption = #1054#1089#1085'. '#1087#1086#1076#1088#1072#1079#1076'.'
        DataBinding.FieldName = 'PODR'
        Width = 94
      end
      object tvPeopleFindSCID: TcxGridDBColumn
        Caption = #8470' '#1044#1057
        DataBinding.FieldName = 'SCID'
        Width = 55
      end
      object tvPeopleFindSTNAME: TcxGridDBColumn
        Caption = #1059#1089#1083#1091#1075#1072
        DataBinding.FieldName = 'STNAME'
        Width = 282
      end
      object tvPeopleFindSCDATEBEGIN: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1085#1072#1095#1072#1083#1072
        DataBinding.FieldName = 'SCDATEBEGIN'
        Width = 76
      end
      object tvPeopleFindSCDATEEND: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1086#1082#1086#1085#1095'.'
        DataBinding.FieldName = 'SCDATEEND'
        Width = 71
      end
      object tvPeopleFindSCTIMEENTER: TcxGridDBColumn
        Caption = #1044#1072#1090#1072' '#1089#1086#1079#1076#1072#1085#1080#1103
        DataBinding.FieldName = 'SCTIMEENTER'
        Width = 97
      end
      object tvPeopleFindSCUSERENTER: TcxGridDBColumn
        Caption = #1040#1074#1090#1086#1088
        DataBinding.FieldName = 'SCUSERENTER'
        Width = 110
      end
    end
    object dbgPeopleFindLevel1: TcxGridLevel
      GridView = tvPeopleFind
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    BufferChunks = 10000
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT APU.PID, (COALESCE(P.PLASTNAME,'#39' '#39')||'#39' '#39'||COALESCE(P.PNAM' +
        'E,'#39' '#39')||'#39' '#39'||COALESCE(P.PPATRONYMIC,'#39' '#39')) AS PP,'
      
        ' SC.SCID, SC.SCDATEBEGIN, SC.SCDATEEND, ST.STNAME, SC.SCTIMEENTE' +
        'R, SC.SCDATE,'
      ' SC.SCUSERENTER, ST.STSYSPODR, DP1.SDNAME AS podr, '
      'st.stsdidtabel'
      'FROM SPEC_COND SC '
      'INNER JOIN AGREEMENTS A ON A.AGID = SC.AGID '
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN SERVICES S ON S.SCID = SC.SCID '
      'INNER JOIN SERVICES_TYPE ST ON ST.STID = S.STID '
      'INNER JOIN PEOPLE P ON P.PID = APU.PID'
      'LEFT OUTER JOIN ( '
      'SELECT apu.PID, sd.SDNAME'
      'FROM DETI_PODRAZD_SC DP '
      'INNER JOIN SPEC_COND SC ON SC.SCID = DP.SCID '
      'INNER JOIN AGR_POLUCH_USLUG APU ON APU.AGID = SC.AGID '
      'INNER JOIN SYS_DIC SD ON SD.SDID = DP.SDID '
      ' where DP.DPTYPE = 1 AND SC.SCISDELETE IS NULL '
      'and  CURRENT_DATE BETWEEN CAST(dp.DPDATEIN AS DATE) '
      '    AND COALESCE(CAST(dp.DPDATEOUT AS DATE), CURRENT_DATE) '
      ') as dp1 on dp1.pid = P.PID'
      'WHERE SC.SCISDELETE is NULL AND A.AGISDELETE IS NULL '
      'and coalesce(SC.SCAPPROVED,0) = 0'
      '-- and coalesce(SC.SCDATERASTORJ, SC.SCDATEEND) >= current_date'
      'ORDER BY 7,2')
    GeneratorField.Field = 'TFID'
    Left = 304
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"AGR_POLUCH_USLUG"."PID"'
      Required = True
    end
    object qPeoplePP: TIBStringField
      FieldName = 'PP'
      ProviderFlags = []
      Size = 767
    end
    object qPeopleSCID: TIntegerField
      FieldName = 'SCID'
      Origin = '"SPEC_COND"."SCID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeopleSCDATEBEGIN: TDateField
      FieldName = 'SCDATEBEGIN'
      Origin = '"SPEC_COND"."SCDATEBEGIN"'
    end
    object qPeopleSCDATEEND: TDateField
      FieldName = 'SCDATEEND'
      Origin = '"SPEC_COND"."SCDATEEND"'
    end
    object qPeopleSTNAME: TIBStringField
      FieldName = 'STNAME'
      Origin = '"SERVICES_TYPE"."STNAME"'
      Size = 255
    end
    object qPeopleSCTIMEENTER: TDateTimeField
      FieldName = 'SCTIMEENTER'
      Origin = '"SPEC_COND"."SCTIMEENTER"'
    end
    object qPeopleSCDATE: TDateField
      FieldName = 'SCDATE'
      Origin = '"SPEC_COND"."SCDATE"'
    end
    object qPeopleSCUSERENTER: TIBStringField
      FieldName = 'SCUSERENTER'
      Origin = '"SPEC_COND"."SCUSERENTER"'
      Size = 40
    end
    object qPeopleSTSYSPODR: TIntegerField
      FieldName = 'STSYSPODR'
      Origin = '"SERVICES_TYPE"."STSYSPODR"'
    end
    object qPeoplePODR: TIBStringField
      FieldName = 'PODR'
      ProviderFlags = []
      Size = 255
    end
    object qPeopleSTSDIDTABEL: TIntegerField
      FieldName = 'STSDIDTABEL'
      Origin = '"SERVICES_TYPE"."STSDIDTABEL"'
    end
  end
end
